/*                     __                                               *\
**     ________ ___   / /  ___      __ ____  Scala.js Test Suite        **
**    / __/ __// _ | / /  / _ | __ / // __/  (c) 2013, LAMP/EPFL        **
**  __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \    http://scala-js.org/       **
** /____/\___/_/ |_/____/_/ | |__/ /____/                               **
**                          |/____/                                     **
\*                                                                      */
package org.scalajs.testsuite.javalib.lang

import org.junit.Test
import org.junit.Assert._

class CharacterTestOnJDK7 {

  @Test
  def shouldProvideIsBmpCodePoint(): Unit = {
    // 50 randomly chosen characters that produce true
    assertTrue(Character.isBmpCodePoint('\u0120'))
    assertTrue(Character.isBmpCodePoint('\u0147'))
    assertTrue(Character.isBmpCodePoint('\u028E'))
    assertTrue(Character.isBmpCodePoint('\u0464'))
    assertTrue(Character.isBmpCodePoint('\u0DB8'))
    assertTrue(Character.isBmpCodePoint('\u1909'))
    assertTrue(Character.isBmpCodePoint('\u1F26'))
    assertTrue(Character.isBmpCodePoint('\u1F7E'))
    assertTrue(Character.isBmpCodePoint('\u2C64'))
    assertTrue(Character.isBmpCodePoint('\u353E'))
    assertTrue(Character.isBmpCodePoint('\u39DB'))
    assertTrue(Character.isBmpCodePoint('\u3E74'))
    assertTrue(Character.isBmpCodePoint('\u3F14'))
    assertTrue(Character.isBmpCodePoint('\u3FB3'))
    assertTrue(Character.isBmpCodePoint('\u4656'))
    assertTrue(Character.isBmpCodePoint('\u4824'))
    assertTrue(Character.isBmpCodePoint('\u488D'))
    assertTrue(Character.isBmpCodePoint('\u4C03'))
    assertTrue(Character.isBmpCodePoint('\u4D87'))
    assertTrue(Character.isBmpCodePoint('\u4F3E'))
    assertTrue(Character.isBmpCodePoint('\u570D'))
    assertTrue(Character.isBmpCodePoint('\u57CF'))
    assertTrue(Character.isBmpCodePoint('\u5A1E'))
    assertTrue(Character.isBmpCodePoint('\u5A3E'))
    assertTrue(Character.isBmpCodePoint('\u5C29'))
    assertTrue(Character.isBmpCodePoint('\u6082'))
    assertTrue(Character.isBmpCodePoint('\u6518'))
    assertTrue(Character.isBmpCodePoint('\u7202'))
    assertTrue(Character.isBmpCodePoint('\u7B3F'))
    assertTrue(Character.isBmpCodePoint('\u93F4'))
    assertTrue(Character.isBmpCodePoint('\u9812'))
    assertTrue(Character.isBmpCodePoint('\u986B'))
    assertTrue(Character.isBmpCodePoint('\uA228'))
    assertTrue(Character.isBmpCodePoint('\uB05E'))
    assertTrue(Character.isBmpCodePoint('\uB4DD'))
    assertTrue(Character.isBmpCodePoint('\uB4EB'))
    assertTrue(Character.isBmpCodePoint('\uB824'))
    assertTrue(Character.isBmpCodePoint('\uB8D4'))
    assertTrue(Character.isBmpCodePoint('\uBA9D'))
    assertTrue(Character.isBmpCodePoint('\uC33E'))
    assertTrue(Character.isBmpCodePoint('\uD0A4'))
    assertTrue(Character.isBmpCodePoint('\uD0D7'))
    assertTrue(Character.isBmpCodePoint('\uD596'))
    assertTrue(Character.isBmpCodePoint('\uDF06'))
    assertTrue(Character.isBmpCodePoint('\uE419'))
    assertTrue(Character.isBmpCodePoint('\uE66A'))
    assertTrue(Character.isBmpCodePoint('\uED6B'))
    assertTrue(Character.isBmpCodePoint('\uEE2A'))
    assertTrue(Character.isBmpCodePoint('\uF116'))
    assertTrue(Character.isBmpCodePoint('\uFC7E'))

    // 50 randomly chosen characters that produce false
    assertFalse(Character.isBmpCodePoint(104494))
    assertFalse(Character.isBmpCodePoint(125793))
    assertFalse(Character.isBmpCodePoint(131158))
    assertFalse(Character.isBmpCodePoint(163501))
    assertFalse(Character.isBmpCodePoint(182050))
    assertFalse(Character.isBmpCodePoint(190085))
    assertFalse(Character.isBmpCodePoint(195066))
    assertFalse(Character.isBmpCodePoint(197399))
    assertFalse(Character.isBmpCodePoint(212487))
    assertFalse(Character.isBmpCodePoint(220872))
    assertFalse(Character.isBmpCodePoint(228423))
    assertFalse(Character.isBmpCodePoint(229980))
    assertFalse(Character.isBmpCodePoint(231638))
    assertFalse(Character.isBmpCodePoint(250644))
    assertFalse(Character.isBmpCodePoint(251190))
    assertFalse(Character.isBmpCodePoint(262467))
    assertFalse(Character.isBmpCodePoint(278850))
    assertFalse(Character.isBmpCodePoint(279865))
    assertFalse(Character.isBmpCodePoint(282442))
    assertFalse(Character.isBmpCodePoint(298662))
    assertFalse(Character.isBmpCodePoint(304549))
    assertFalse(Character.isBmpCodePoint(329478))
    assertFalse(Character.isBmpCodePoint(425451))
    assertFalse(Character.isBmpCodePoint(432483))
    assertFalse(Character.isBmpCodePoint(459609))
    assertFalse(Character.isBmpCodePoint(468002))
    assertFalse(Character.isBmpCodePoint(481274))
    assertFalse(Character.isBmpCodePoint(493980))
    assertFalse(Character.isBmpCodePoint(504523))
    assertFalse(Character.isBmpCodePoint(531036))
    assertFalse(Character.isBmpCodePoint(544623))
    assertFalse(Character.isBmpCodePoint(580236))
    assertFalse(Character.isBmpCodePoint(604965))
    assertFalse(Character.isBmpCodePoint(605557))
    assertFalse(Character.isBmpCodePoint(608870))
    assertFalse(Character.isBmpCodePoint(611891))
    assertFalse(Character.isBmpCodePoint(631390))
    assertFalse(Character.isBmpCodePoint(679492))
    assertFalse(Character.isBmpCodePoint(694553))
    assertFalse(Character.isBmpCodePoint(879975))
    assertFalse(Character.isBmpCodePoint(926901))
    assertFalse(Character.isBmpCodePoint(934288))
    assertFalse(Character.isBmpCodePoint(951314))
    assertFalse(Character.isBmpCodePoint(952297))
    assertFalse(Character.isBmpCodePoint(965942))
    assertFalse(Character.isBmpCodePoint(1003588))
    assertFalse(Character.isBmpCodePoint(1005139))
    assertFalse(Character.isBmpCodePoint(1043178))
    assertFalse(Character.isBmpCodePoint(1075598))
    assertFalse(Character.isBmpCodePoint(1097392))
  }

  @Test
  def shouldProvideIsAlphabetic(): Unit = {
    // 50 randomly chosen characters that produce true
    assertTrue(Character.isAlphabetic('\u04F8'))
    assertTrue(Character.isAlphabetic('\u05DB'))
    assertTrue(Character.isAlphabetic('\u1314'))
    assertTrue(Character.isAlphabetic('\u3515'))
    assertTrue(Character.isAlphabetic('\u3780'))
    assertTrue(Character.isAlphabetic('\u391C'))
    assertTrue(Character.isAlphabetic('\u3B06'))
    assertTrue(Character.isAlphabetic('\u3FEF'))
    assertTrue(Character.isAlphabetic('\u47CF'))
    assertTrue(Character.isAlphabetic('\u5076'))
    assertTrue(Character.isAlphabetic('\u5684'))
    assertTrue(Character.isAlphabetic('\u5773'))
    assertTrue(Character.isAlphabetic('\u591C'))
    assertTrue(Character.isAlphabetic('\u59A0'))
    assertTrue(Character.isAlphabetic('\u5B09'))
    assertTrue(Character.isAlphabetic('\u6775'))
    assertTrue(Character.isAlphabetic('\u7434'))
    assertTrue(Character.isAlphabetic('\u83FB'))
    assertTrue(Character.isAlphabetic('\u8761'))
    assertTrue(Character.isAlphabetic('\u8993'))
    assertTrue(Character.isAlphabetic('\u947A'))
    assertTrue(Character.isAlphabetic('\u98AB'))
    assertTrue(Character.isAlphabetic('\u98DA'))
    assertTrue(Character.isAlphabetic('\u9B44'))
    assertTrue(Character.isAlphabetic('\uADFF'))
    assertTrue(Character.isAlphabetic('\uC091'))
    assertTrue(Character.isAlphabetic('\uC43F'))
    assertTrue(Character.isAlphabetic('\uCB5D'))
    assertTrue(Character.isAlphabetic(133889))
    assertTrue(Character.isAlphabetic(134427))
    assertTrue(Character.isAlphabetic(134471))
    assertTrue(Character.isAlphabetic(138909))
    assertTrue(Character.isAlphabetic(139164))
    assertTrue(Character.isAlphabetic(140493))
    assertTrue(Character.isAlphabetic(148737))
    assertTrue(Character.isAlphabetic(149345))
    assertTrue(Character.isAlphabetic(151435))
    assertTrue(Character.isAlphabetic(156857))
    assertTrue(Character.isAlphabetic(158440))
    assertTrue(Character.isAlphabetic(159937))
    assertTrue(Character.isAlphabetic(159952))
    assertTrue(Character.isAlphabetic(163859))
    assertTrue(Character.isAlphabetic(166872))
    assertTrue(Character.isAlphabetic(167076))
    assertTrue(Character.isAlphabetic(168670))
    assertTrue(Character.isAlphabetic(170390))
    assertTrue(Character.isAlphabetic(170999))
    assertTrue(Character.isAlphabetic(172036))
    assertTrue(Character.isAlphabetic(173135))
    assertTrue(Character.isAlphabetic(176898))

    // 50 randomly chosen characters that produce false
    assertFalse(Character.isAlphabetic(1002047))
    assertFalse(Character.isAlphabetic(1009593))
    assertFalse(Character.isAlphabetic(1042564))
    assertFalse(Character.isAlphabetic(1052587))
    assertFalse(Character.isAlphabetic(1061824))
    assertFalse(Character.isAlphabetic(1077156))
    assertFalse(Character.isAlphabetic(1077935))
    assertFalse(Character.isAlphabetic(108164))
    assertFalse(Character.isAlphabetic(117071))
    assertFalse(Character.isAlphabetic(180747))
    assertFalse(Character.isAlphabetic(235975))
    assertFalse(Character.isAlphabetic(256440))
    assertFalse(Character.isAlphabetic(291721))
    assertFalse(Character.isAlphabetic(313351))
    assertFalse(Character.isAlphabetic(333549))
    assertFalse(Character.isAlphabetic(353806))
    assertFalse(Character.isAlphabetic(390947))
    assertFalse(Character.isAlphabetic(400920))
    assertFalse(Character.isAlphabetic(403305))
    assertFalse(Character.isAlphabetic(417636))
    assertFalse(Character.isAlphabetic(419085))
    assertFalse(Character.isAlphabetic(443247))
    assertFalse(Character.isAlphabetic(468248))
    assertFalse(Character.isAlphabetic(485549))
    assertFalse(Character.isAlphabetic(491917))
    assertFalse(Character.isAlphabetic(511059))
    assertFalse(Character.isAlphabetic(530210))
    assertFalse(Character.isAlphabetic(569030))
    assertFalse(Character.isAlphabetic(595429))
    assertFalse(Character.isAlphabetic(607797))
    assertFalse(Character.isAlphabetic(654788))
    assertFalse(Character.isAlphabetic(660783))
    assertFalse(Character.isAlphabetic(715383))
    assertFalse(Character.isAlphabetic(752828))
    assertFalse(Character.isAlphabetic(778169))
    assertFalse(Character.isAlphabetic(781077))
    assertFalse(Character.isAlphabetic(796535))
    assertFalse(Character.isAlphabetic(819655))
    assertFalse(Character.isAlphabetic(850895))
    assertFalse(Character.isAlphabetic(866871))
    assertFalse(Character.isAlphabetic(885354))
    assertFalse(Character.isAlphabetic(908455))
    assertFalse(Character.isAlphabetic(908635))
    assertFalse(Character.isAlphabetic(924461))
    assertFalse(Character.isAlphabetic(930019))
    assertFalse(Character.isAlphabetic(948273))
    assertFalse(Character.isAlphabetic(974041))
    assertFalse(Character.isAlphabetic(977329))
    assertFalse(Character.isAlphabetic(99202))
    assertFalse(Character.isAlphabetic(993967))
  }

  @Test
  def shouldProvideIsIdeographic(): Unit = {
    // 50 randomly chosen characters that produce true
    assertTrue(Character.isIdeographic('\u388F'))
    assertTrue(Character.isIdeographic('\u4711'))
    assertTrue(Character.isIdeographic('\u527E'))
    assertTrue(Character.isIdeographic('\u5328'))
    assertTrue(Character.isIdeographic('\u5922'))
    assertTrue(Character.isIdeographic('\u5BA2'))
    assertTrue(Character.isIdeographic('\u5CAC'))
    assertTrue(Character.isIdeographic('\u65AF'))
    assertTrue(Character.isIdeographic('\u694C'))
    assertTrue(Character.isIdeographic('\u8068'))
    assertTrue(Character.isIdeographic('\u8C34'))
    assertTrue(Character.isIdeographic('\u8C9D'))
    assertTrue(Character.isIdeographic('\u8D3D'))
    assertTrue(Character.isIdeographic('\u9C62'))
    assertTrue(Character.isIdeographic(131994))
    assertTrue(Character.isIdeographic(132852))
    assertTrue(Character.isIdeographic(133501))
    assertTrue(Character.isIdeographic(133591))
    assertTrue(Character.isIdeographic(134246))
    assertTrue(Character.isIdeographic(134328))
    assertTrue(Character.isIdeographic(136431))
    assertTrue(Character.isIdeographic(139867))
    assertTrue(Character.isIdeographic(140528))
    assertTrue(Character.isIdeographic(141460))
    assertTrue(Character.isIdeographic(146741))
    assertTrue(Character.isIdeographic(146759))
    assertTrue(Character.isIdeographic(147539))
    assertTrue(Character.isIdeographic(148459))
    assertTrue(Character.isIdeographic(148689))
    assertTrue(Character.isIdeographic(153593))
    assertTrue(Character.isIdeographic(155694))
    assertTrue(Character.isIdeographic(155818))
    assertTrue(Character.isIdeographic(159961))
    assertTrue(Character.isIdeographic(163220))
    assertTrue(Character.isIdeographic(163464))
    assertTrue(Character.isIdeographic(164167))
    assertTrue(Character.isIdeographic(164197))
    assertTrue(Character.isIdeographic(165508))
    assertTrue(Character.isIdeographic(165973))
    assertTrue(Character.isIdeographic(167743))
    assertTrue(Character.isIdeographic(168585))
    assertTrue(Character.isIdeographic(168758))
    assertTrue(Character.isIdeographic(169731))
    assertTrue(Character.isIdeographic(170186))
    assertTrue(Character.isIdeographic(171240))
    assertTrue(Character.isIdeographic(171988))
    assertTrue(Character.isIdeographic(172886))
    assertTrue(Character.isIdeographic(174236))
    assertTrue(Character.isIdeographic(177495))
    assertTrue(Character.isIdeographic(178011))

    // 50 randomly chosen characters that produce false
    assertFalse(Character.isIdeographic('\uFB45'))
    assertFalse(Character.isIdeographic(1005864))
    assertFalse(Character.isIdeographic(1006626))
    assertFalse(Character.isIdeographic(1009910))
    assertFalse(Character.isIdeographic(1032559))
    assertFalse(Character.isIdeographic(1040837))
    assertFalse(Character.isIdeographic(1070571))
    assertFalse(Character.isIdeographic(107607))
    assertFalse(Character.isIdeographic(1084694))
    assertFalse(Character.isIdeographic(1098896))
    assertFalse(Character.isIdeographic(121214))
    assertFalse(Character.isIdeographic(193874))
    assertFalse(Character.isIdeographic(208650))
    assertFalse(Character.isIdeographic(253670))
    assertFalse(Character.isIdeographic(266437))
    assertFalse(Character.isIdeographic(268828))
    assertFalse(Character.isIdeographic(269494))
    assertFalse(Character.isIdeographic(278691))
    assertFalse(Character.isIdeographic(282114))
    assertFalse(Character.isIdeographic(294021))
    assertFalse(Character.isIdeographic(334194))
    assertFalse(Character.isIdeographic(351339))
    assertFalse(Character.isIdeographic(356942))
    assertFalse(Character.isIdeographic(388239))
    assertFalse(Character.isIdeographic(398495))
    assertFalse(Character.isIdeographic(424210))
    assertFalse(Character.isIdeographic(437688))
    assertFalse(Character.isIdeographic(454763))
    assertFalse(Character.isIdeographic(499908))
    assertFalse(Character.isIdeographic(543025))
    assertFalse(Character.isIdeographic(544352))
    assertFalse(Character.isIdeographic(552973))
    assertFalse(Character.isIdeographic(557901))
    assertFalse(Character.isIdeographic(570614))
    assertFalse(Character.isIdeographic(607804))
    assertFalse(Character.isIdeographic(639906))
    assertFalse(Character.isIdeographic(659980))
    assertFalse(Character.isIdeographic(668239))
    assertFalse(Character.isIdeographic(711022))
    assertFalse(Character.isIdeographic(765532))
    assertFalse(Character.isIdeographic(776989))
    assertFalse(Character.isIdeographic(777331))
    assertFalse(Character.isIdeographic(812822))
    assertFalse(Character.isIdeographic(815221))
    assertFalse(Character.isIdeographic(828259))
    assertFalse(Character.isIdeographic(82920))
    assertFalse(Character.isIdeographic(869335))
    assertFalse(Character.isIdeographic(912462))
    assertFalse(Character.isIdeographic(958559))
    assertFalse(Character.isIdeographic(999076))
  }
}
